---
title: Embeddings
---

[Embedding models](/oss/concepts/embedding_models) create a vector representation of a piece of text.

This page documents integrations with various model providers that allow you to use embeddings in LangChain.

<Tabs>
<Tab title="OpenAI">

#### Install dependencies

<Tabs>
<Tab title="npm">

```bash
npm i @langchain/openai
```

</Tab>
<Tab title="yarn">

```bash
yarn add @langchain/openai
```

</Tab>
<Tab title="pnpm">

```bash
pnpm add @langchain/openai
```

</Tab>
</Tabs>

#### Add environment variables

```bash
OPENAI_API_KEY=your-api-key
```

#### Instantiate the model

```typescript
import { OpenAIEmbeddings } from "@langchain/openai";

const embeddings = new OpenAIEmbeddings({
  model: "text-embedding-3-large"
});
```

</Tab>
<Tab title="Azure">

#### Install dependencies

<Tabs>
<Tab title="npm">

```bash
npm i @langchain/openai
```

</Tab>
<Tab title="yarn">

```bash
yarn add @langchain/openai
```

</Tab>
<Tab title="pnpm">

```bash
pnpm add @langchain/openai
```

</Tab>
</Tabs>

#### Add environment variables

```bash
AZURE_OPENAI_API_INSTANCE_NAME=<YOUR_INSTANCE_NAME>
AZURE_OPENAI_API_KEY=<YOUR_KEY>
AZURE_OPENAI_API_VERSION="2024-02-01"
```

#### Instantiate the model

```typescript
import { AzureOpenAIEmbeddings } from "@langchain/openai";

const embeddings = new AzureOpenAIEmbeddings({
  azureOpenAIApiEmbeddingsDeploymentName: "text-embedding-ada-002"
});
```

</Tab>
<Tab title="AWS">

#### Install dependencies

<Tabs>
<Tab title="npm">

```bash
npm i @langchain/aws
```

</Tab>
<Tab title="yarn">

```bash
yarn add @langchain/aws
```

</Tab>
<Tab title="pnpm">

```bash
pnpm add @langchain/aws
```

</Tab>
</Tabs>

#### Add environment variables

```bash
BEDROCK_AWS_REGION=your-region
```

#### Instantiate the model

```typescript
import { BedrockEmbeddings } from "@langchain/aws";

const embeddings = new BedrockEmbeddings({
  model: "amazon.titan-embed-text-v1"
});
```

</Tab>
<Tab title="VertexAI">

#### Install dependencies

<Tabs>
<Tab title="npm">

```bash
npm i @langchain/google-vertexai
```

</Tab>
<Tab title="yarn">

```bash
yarn add @langchain/google-vertexai
```

</Tab>
<Tab title="pnpm">

```bash
pnpm add @langchain/google-vertexai
```

</Tab>
</Tabs>

#### Add environment variables

```bash
GOOGLE_APPLICATION_CREDENTIALS=credentials.json
```

#### Instantiate the model

```typescript
import { VertexAIEmbeddings } from "@langchain/google-vertexai";

const embeddings = new VertexAIEmbeddings({
  model: "gemini-embedding-001"
});
```

</Tab>
<Tab title="MistralAI">

#### Install dependencies

<Tabs>
<Tab title="npm">

```bash
npm i @langchain/mistralai
```

</Tab>
<Tab title="yarn">

```bash
yarn add @langchain/mistralai
```

</Tab>
<Tab title="pnpm">

```bash
pnpm add @langchain/mistralai
```

</Tab>
</Tabs>

#### Add environment variables

```bash
MISTRAL_API_KEY=your-api-key
```

#### Instantiate the model

```typescript
import { MistralAIEmbeddings } from "@langchain/mistralai";

const embeddings = new MistralAIEmbeddings({
  model: "mistral-embed"
});
```

</Tab>
<Tab title="Cohere">

#### Install dependencies

<Tabs>
<Tab title="npm">

```bash
npm i @langchain/cohere
```

</Tab>
<Tab title="yarn">

```bash
yarn add @langchain/cohere
```

</Tab>
<Tab title="pnpm">

```bash
pnpm add @langchain/cohere
```

</Tab>
</Tabs>

#### Add environment variables

```bash
COHERE_API_KEY=your-api-key
```

#### Instantiate the model

```typescript
import { CohereEmbeddings } from "@langchain/cohere";

const embeddings = new CohereEmbeddings({
  model: "embed-english-v3.0"
});
```

</Tab>
</Tabs>

```javascript
await embeddings.embedQuery("Hello, world!");
```

## All embedding models

<Columns cols={3}>
  <Card
    title="Alibaba Tongyi"
    icon="link"
    href="/oss/integrations/text_embedding/alibaba_tongyi"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Azure OpenAI"
    icon="link"
    href="/oss/integrations/text_embedding/azure_openai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Baidu Qianfan"
    icon="link"
    href="/oss/integrations/text_embedding/baidu_qianfan"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Amazon Bedrock"
    icon="link"
    href="/oss/integrations/text_embedding/bedrock"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="ByteDance Doubao"
    icon="link"
    href="/oss/integrations/text_embedding/bytedance_doubao"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Cloudflare Workers AI"
    icon="link"
    href="/oss/integrations/text_embedding/cloudflare_ai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Cohere"
    icon="link"
    href="/oss/integrations/text_embedding/cohere"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="DeepInfra"
    icon="link"
    href="/oss/integrations/text_embedding/deepinfra"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Fireworks"
    icon="link"
    href="/oss/integrations/text_embedding/fireworks"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Google Generative AI"
    icon="link"
    href="/oss/integrations/text_embedding/google_generativeai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Google Vertex AI"
    icon="link"
    href="/oss/integrations/text_embedding/google_vertex_ai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Gradient AI"
    icon="link"
    href="/oss/integrations/text_embedding/gradient_ai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="HuggingFace Inference"
    icon="link"
    href="/oss/integrations/text_embedding/hugging_face_inference"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="IBM watsonx.ai"
    icon="link"
    href="/oss/integrations/text_embedding/ibm"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Jina"
    icon="link"
    href="/oss/integrations/text_embedding/jina"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Llama CPP"
    icon="link"
    href="/oss/integrations/text_embedding/llama_cpp"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Minimax"
    icon="link"
    href="/oss/integrations/text_embedding/minimax"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="MistralAI"
    icon="link"
    href="/oss/integrations/text_embedding/mistralai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Mixedbread AI"
    icon="link"
    href="/oss/integrations/text_embedding/mixedbread_ai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Nomic"
    icon="link"
    href="/oss/integrations/text_embedding/nomic"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Ollama"
    icon="link"
    href="/oss/integrations/text_embedding/ollama"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="OpenAI"
    icon="link"
    href="/oss/integrations/text_embedding/openai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Pinecone"
    icon="link"
    href="/oss/integrations/text_embedding/pinecone"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Prem AI"
    icon="link"
    href="/oss/integrations/text_embedding/premai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Tencent Hunyuan"
    icon="link"
    href="/oss/integrations/text_embedding/tencent_hunyuan"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="TensorFlow"
    icon="link"
    href="/oss/integrations/text_embedding/tensorflow"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="TogetherAI"
    icon="link"
    href="/oss/integrations/text_embedding/togetherai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="HuggingFace Transformers"
    icon="link"
    href="/oss/integrations/text_embedding/transformers"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="Voyage AI"
    icon="link"
    href="/oss/integrations/text_embedding/voyageai"
    arrow="true"
    cta="View guide"
  >
  </Card>
  <Card
    title="ZhipuAI"
    icon="link"
    href="/oss/integrations/text_embedding/zhipuai"
    arrow="true"
    cta="View guide"
  >
  </Card>
</Columns>
